﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =========================GetPropertyById====================
CREATE PROCEDURE GetPropertyById
	-- Add the parameters for the stored procedure here
	@PropertyId uniqueidentifier
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	--GET Property
	SELECT ap.* , ar.LocationId, al.StateId FROM AW_Property ap
	JOIN  AW_Road ar on ar.RoadId = ap.RoadId
	JOIN AW_Location al on al.LocationId = ar.LocationId
	JOIN AW_State st on st.StateId = al.StateId WHERE PropertyId = @PropertyId
END